<template>
  <f7-page>
    <f7-navbar title="转账记录" back-link="返回"></f7-navbar>

    <f7-row class="table-title text-align-center">
      <f7-col width="20"><span class="text-shadow">金额</span></f7-col>
      <f7-col width="40"><span class="text-shadow">时间</span></f7-col>
      <f7-col width="40"><span class="text-shadow">内容</span></f7-col>
    </f7-row>
    <f7-row class="table-title text-align-center" v-for="(item, index) in record" :key="index">
      <f7-col width="20">{{item.money}}</f7-col>
      <f7-col width="40">{{$moment(item.add_time * 1000).format('YYYY-MM-DD')}}</f7-col>
      <f7-col width="40">{{item.content}}</f7-col>
    </f7-row>
  </f7-page>
</template>

<script>
  import { transRecord, exchangeRecord } from "../api/home";

  export default {
    name: "transfer-record",
    data() {
      return {
        record: []
      }
    },
    mounted() {
      this.init();
      console.log(this.$f7route)
    },
    methods: {
      init() {
        // console.log(this.$f7route.query)
        if (this.$f7route.query.type === '1') {
          transRecord().then(res => {
            this.record = res.data;
          })
        } else {
          exchangeRecord().then(res => {
            this.record = res.data;
          })
        }

      }
    }
  }
</script>

<style scoped>

</style>